Skip to content

fix(windows): default file edits to structured apply_patch#592

Open
voarsh2 wants to merge 2 commits into
just-every:mainfrom
voarsh2:windows-apply-patch-structured
Open

fix(windows): default file edits to structured apply_patch#592
voarsh2 wants to merge 2 commits into
just-every:mainfrom
voarsh2:windows-apply-patch-structured

Conversation

@voarsh2

@voarsh2 voarsh2 commented Jun 8, 2026

Copy link
Copy Markdown

Summary

On Windows, default file edits should use the structured apply_patch tool instead of relying on shell-script patch invocations.

The existing Windows-specific handling already maps apply_patch to the function tool when it is enabled, because freeform/heredoc-style patch commands are unreliable in native Windows shells. However, shell-command model families can currently default to shell_command without exposing the dedicated apply_patch tool, which makes edits more likely to route through the less reliable shell path.

This change:

  • enables the dedicated apply_patch tool by default on Windows
  • keeps shell-command model routing from displacing that edit path while apply_patch is enabled
  • preserves shell_command behavior when apply_patch is not enabled
  • adds unit coverage for the Windows-specific routing decisions

Testing

  • Confirmed on a private Windows build that file edits route through the dedicated apply_patch path successfully.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9e48a6195

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

.unwrap_or("https://chatgpt.com/backend-api/".to_string()),
include_plan_tool: include_plan_tool.unwrap_or(false),
include_apply_patch_tool: include_apply_patch_tool.unwrap_or(false),
include_apply_patch_tool: include_apply_patch_tool.unwrap_or(cfg!(target_os = "windows")),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wire the default apply_patch tool to an executor

On Windows this now enables the structured apply_patch tool by default, but the function-call dispatcher still has no "apply_patch" arm; I checked handle_function_call, where unknown names fall through to unsupported call: {name}. For any Windows session using a model with apply_patch_tool_type set, the advertised edit path will therefore fail as soon as the model calls apply_patch instead of applying the patch.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants